<template>
  <div>
    <h3>温州理工滨海校区</h3>
    <input type="text" v-model.number="id">
    <button @click="search">搜索</button><br>
    <div v-if="id==student.id && isSearched">
      <p>学生信息</p><br>
      <p>学号{{student.id}}</p><br>
      <p>姓名{{student.name}}</p><br>
      <p>年龄{{student.age}}</p><br>
      <p>专业{{student.course}}</p>
    </div>
  </div>
</template>

<script>
  export default{
    data(){
      return{
        id:'',
        isSearched: false,
        student:{
          id: 123456,
          name: '小明',
          age: 20,
          course: '计算机科学'
        }
      }
    },
    methods: {
      search() {
        this.isSearched=true;
      }
    }
  }
</script>


